package com.xs.designpattern;

import lombok.RequiredArgsConstructor;

/**
 * 数字表达
 * @author xs
 */
@RequiredArgsConstructor
public class NumberExpression extends Expression {
    private final int number;

    public NumberExpression(String s) {
        this.number = Integer.parseInt(s);
    }

    @Override
    public int interpret() {
        return number;
    }

    @Override
    public String toString() {
        return "number";
    }
}
